package com.codeoss.framework.view.pagebean.crud;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.codeoss.framework.data.metadata.Query;
import com.codeoss.framework.data.metadata.Table;

public class SelectRequest {
	private Table mainTable;
	private List<Table> subTableList=new ArrayList<Table>();
	private Query mainQuery;
	private Map<String,Query> subQueryMap=new HashMap<String,Query>();
	private boolean batchSelect;
	public Table getMainTable() {
		return mainTable;
	}
	public void setMainTable(Table mainTable) {
		this.mainTable = mainTable;
	}
	public List<Table> getSubTableList() {
		return subTableList;
	}
	public void setSubTableList(List<Table> subTableList) {
		this.subTableList = subTableList;
	}
	public Query getMainQuery() {
		return mainQuery;
	}
	public void setMainQuery(Query mainQuery) {
		this.mainQuery = mainQuery;
	}
	public Map<String, Query> getSubQueryMap() {
		return subQueryMap;
	}
	public void setSubQueryMap(Map<String, Query> subQueryMap) {
		this.subQueryMap = subQueryMap;
	}
	
	public void addSubTable(Table table) {
		subTableList.add(table);
	}
	
	public void addSubQuery(String tableName,Query query) {
		subQueryMap.put(tableName, query);
	}
	public boolean isBatchSelect() {
		return batchSelect;
	}
	public void setBatchSelect(boolean batchSelect) {
		this.batchSelect = batchSelect;
	}
}
